package com.itheima.task;

import com.itheima.service.db.AnalysisByDayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

//日志同步任务
@Component
public class AnalysisTask {

    @Autowired
    AnalysisByDayService analysisByDayService;

    //@Scheduled(cron = "0 0 0/1 * * ?") //每个小时
    @Scheduled(cron = "0 0/1 * * * ?")//测试每分钟执行一次
    public void ansyAnalysis(){
        System.out.println("同步分析统计表开始---");
        analysisByDayService.saveOrUpdate();
        System.out.println("同步分析统计表结束---");
    }
}
